package com.matou.server.api.system.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户信息表
 * @TableName t_user
 */
@Data
@TableName(value ="t_user")
public class TUser implements Serializable {

    private static final long serialVersionUID = -4352868070794165001L;

    // 用户状态：有效
    public static final Integer STATUS_VALID = 0;
    // 用户状态：锁定
    public static final String STATUS_LOCK = "0";
    // 默认头像
    public static final String DEFAULT_AVATAR = "default.jpg";
    // 默认密码
    public static final String DEFAULT_PASSWORD = "1234qwer";
    // 性别男
    public static final String SEX_MALE = "0";
    // 性别女
    public static final String SEX_FEMALE = "1";
    // 性别保密
    public static final String SEX_UNKNOW = "2";
    /**
     * 
     */
    @TableId
    private String id;

    /**
     * 用户名
     */
    private String userName;

    /**
     * 昵称
     */
    private String realName;

    /**
     * 密码
     */
    private String password;

    /**
     * 邮箱地址
     */
    private String email;

    /**
     * 是否删除 1删除 0正常
     */
    private Integer remove;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 发送邮件密码
     */
    private String emailPassword;

    /**
     * 服务器地址
     */
    private String emailHost;

    /**
     * 服务器端口号
     */
    private String emailPort;

    /**
     * 邮件协议
     */
    private String emailProtocol;


    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TUser other = (TUser) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
            && (this.getRealName() == null ? other.getRealName() == null : this.getRealName().equals(other.getRealName()))
            && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
            && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
            && (this.getRemove() == null ? other.getRemove() == null : this.getRemove().equals(other.getRemove()))
            && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getEmailPassword() == null ? other.getEmailPassword() == null : this.getEmailPassword().equals(other.getEmailPassword()))
            && (this.getEmailHost() == null ? other.getEmailHost() == null : this.getEmailHost().equals(other.getEmailHost()))
            && (this.getEmailPort() == null ? other.getEmailPort() == null : this.getEmailPort().equals(other.getEmailPort()))
            && (this.getEmailProtocol() == null ? other.getEmailProtocol() == null : this.getEmailProtocol().equals(other.getEmailProtocol()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
        result = prime * result + ((getRealName() == null) ? 0 : getRealName().hashCode());
        result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
        result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
        result = prime * result + ((getRemove() == null) ? 0 : getRemove().hashCode());
        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getEmailPassword() == null) ? 0 : getEmailPassword().hashCode());
        result = prime * result + ((getEmailHost() == null) ? 0 : getEmailHost().hashCode());
        result = prime * result + ((getEmailPort() == null) ? 0 : getEmailPort().hashCode());
        result = prime * result + ((getEmailProtocol() == null) ? 0 : getEmailProtocol().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userName=").append(userName);
        sb.append(", realName=").append(realName);
        sb.append(", password=").append(password);
        sb.append(", email=").append(email);
        sb.append(", remove=").append(remove);
        sb.append(", phone=").append(phone);
        sb.append(", createTime=").append(createTime);
        sb.append(", emailPassword=").append(emailPassword);
        sb.append(", emailHost=").append(emailHost);
        sb.append(", emailPort=").append(emailPort);
        sb.append(", emailProtocol=").append(emailProtocol);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}